package com.dayuan.constant;

public enum ConstantCode implements BaseCode{
	FAIL(0, "网络请求失败，请稍后再试"), SUCCESS(1, "请求成功"), 
	PARAM_EMPTY(1001, "参数不正确"), 
	CODE_ERROR(1002, "验证码不正确"),
	
	STORE_LOW(2001, "库存不足");

	private int code;
	private String msg;

	ConstantCode(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	public static void main(String[] args) {
		System.out.println(ConstantCode.FAIL.getMsg());
	}

	@Override
	public String printMsg() {
		return code+","+msg;
	}
}


interface BaseCode{
	public String printMsg();
}


